#pragma once

#include "Renderer/VertexArray.h"

/*
 * 顶点数组，存放顶点缓存的类
 * 把顶点缓存推送显卡里， 把步长推送到显卡里
 * */
namespace Hazel {
    // 顶点数组
    class OpenGLVertexArray : public VertexArray{
    public:
        OpenGLVertexArray();
        virtual ~OpenGLVertexArray();

        virtual void Bind() const override;
        virtual void Unbind() const override;


        virtual void AddVertexBuffer(const Ref<VertexBuffer>& vertexBuffer) override;
        virtual void SetIndexBuffer(Ref<IndexBuffer>& indexBuffer) override;

        virtual const std::vector<Ref<VertexBuffer>>& GetVertexBuffers() const {
            return m_VertexBuffers;
        };
        virtual const Ref<IndexBuffer>& GetIndexBuffer() const {
            return m_IndexBuffer;
        };

    private:
        uint32_t m_RendererID;
        std::vector<Ref<VertexBuffer>> m_VertexBuffers;
        Ref<IndexBuffer> m_IndexBuffer;
    };
}
